6 * @covers FormattedRCFeed
8 * @covers JSONRCFeedFormatter
9 * @covers MachineReadableRCFeedFormatter
12 class RCFeedIntegrationTest
extends MediaWikiTestCase
{
13 protected function setUp() {
15 $this->setMwGlobals( [
16 'wgCanonicalServer' => 'https://example.org',
17 'wgServerName' => 'example.org',
18 'wgScriptPath' => '/w',
19 'wgDBname' => 'example',
20 'wgDBprefix' => $this->dbPrefix(),
26 public function testNotify() {
27 $feed = $this->getMockBuilder( RCFeedEngine
::class )
28 ->setConstructorArgs( [ [ 'formatter' => JSONRCFeedFormatter
::class ] ] )
29 ->setMethods( [ 'send' ] )
32 $feed->method( 'send' )
35 $feed->expects( $this->once() )
37 ->with( $this->anything(), $this->callback( function ( $line ) {
38 $this->assertJsonStringEqualsJsonString(
45 'timestamp' => 1301644800,
50 'log_action' => 'move',
56 'log_action_comment' => '',
57 'server_url' => 'https://example.org',
58 'server_name' => 'example.org',
59 'server_script_path' => '/w',
60 'wiki' => 'example-' . $this->dbPrefix(),
67 $this->setMwGlobals( [
70 'uri' => 'test://localhost:1234',
71 'formatter' => JSONRCFeedFormatter
::class,
78 $logpage = SpecialPage
::getTitleFor( 'Log', 'move' );
79 $user = $this->getTestSysop()->getUser();
80 $rc = RecentChange
::newLogEntry(
88 Title
::makeTitle( 0, 'Example' ), // $target
90 LogEntryBase
::makeParamBlob( [
91 '4::color' => 'green',